#include <stdio.h>

#define M 5
#define N 3

//归并排序
int main()
{
    int A[M] = {1,3,5,7,9};
    int B[N] = {2,4,6};

    int C[M+N];
    int i = 0, j = 0, k = 0;
    while (i<M && j<N) {
        if(A[i] < B[j])
            C[k++] = A[i++];
        else {
            C[k++] = B[j++];
        }
    }

//    if(j == 3)
//    {
        while (i<5) {
            C[k++] = A[i++];
        }
//    }
//    if(i == 5)
//    {
        while (j<3) {
            C[k++] = B[j++];
        }
//    }

    for(int i = 0; i<M+N; i++)
    {
        printf("%d\n",C[i]);
    }

    return 0;
}
